import { createRouter, createWebHashHistory } from 'vue-router'
import start from '@/views/start'
import home from '@/views/home'
import dataM from '@/views/dataM/dataM'
import modelD from '@/views/modelD/modelD'
import aiApp from '@/views/aiApp/aiApp'

import environmentSetup from '@/views/envSetup/environmentSetup'
import step1 from '@/views/envSetup/step1'
import step2 from '@/views/envSetup/step2'

import fsConfig from '@/views/dataM/fsConfig/fsConfig'
import fsConfigStep1 from '@/views/dataM/fsConfig/step1'
import fsConfigStep2 from '@/views/dataM/fsConfig/step2'

import workSpace from '@/views/modelD/workSpace'
import dispatcher from '@/views/modelD/dispatcher'
import registry from '@/views/modelD/registry'

import deployment from '@/views/aiApp/deployment/deployment'
import deploymentStep1 from '@/views/aiApp/deployment/step1'
import deploymentStep2 from '@/views/aiApp/deployment/step2'

const routes = [
    {
        path: '/',
        name: 'start',
        component: start,
    },
    {
        path: '/home',
        name: 'home',
        component: home,
    },
    {
        path: '/dataM',
        name: 'dataM',
        component: dataM,
    },
    {
        path: '/fsConfig',
        name: 'fsConfig',
        redirect: '/fsConfig/1',
        component: fsConfig,
        children: [
            {
                path: '1',
                name: 'fsConfigStep1',
                component: fsConfigStep1,
            },{
                path: '2',
                name: 'fsConfigStep2',
                component: fsConfigStep2,
        }]
    },
    {
        path: '/modelD',
        name: 'modelD',
        component: modelD,
        redirect: '/modelD/workSpace',
        children: [
            {
                path: 'registry',
                name: 'registry',
                component: registry,
            },{
                path: 'workSpace',
                name: 'workSpace',
                component: workSpace,
        },{
                path: 'dispatcher',
                name: 'dispatcher',
                component: dispatcher,
        }]
    },
    {
        path: '/aiApp',
        name: 'aiApp',
        component: aiApp,
    },{
        path: '/deployment',
        name: 'deployment',
        component: deployment,
        redirect: '/deployment/1',
        children: [
            {
                path: '1',
                name: 'deploymentStep1',
                component: deploymentStep1,
            },{
                path: '2',
                name: 'deploymentStep2',
                component: deploymentStep2,
            }
        ]
    },
    {
        path: '/setup',
        name: 'environmentSetup',
        component: environmentSetup,
        redirect: '/setup/1',
        children: [
            {
                path: '1',
                name: '1',
                component: step1,
            },{
                path: '2',
                name: '2',
                component: step2,
            }
        ]
    },
]

const router = createRouter({
    mode: 'hash',
    history: createWebHashHistory(),
    routes
})

export default router
